package com.atguigu.gmall.activity.client;

import com.atguigu.gmall.activity.client.impl.ActivittyFeignClientImpl;
import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.activity.SeckillGoods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Fxz
 * @version 1.0
 * @date 2022-02-25 16:25
 */
@SuppressWarnings("all")
@FeignClient(value = "service-activity", fallbackFactory = ActivittyFeignClientImpl.class)
public interface ActivittyFeignClient {

	/**
	 * 查询所有秒杀商品
	 */
	@GetMapping("/api/activity/seckill/findAll")
	public Result<List<SeckillGoods>> findAll();

	/**
	 * 根据skuId查询秒杀商品
	 */
	@GetMapping("/api/activity/seckill/getSeckillGoods/{skuId}")
	public Result<SeckillGoods> getSeckillGoods(@PathVariable("skuId") Long skuId);

	/**
	 * 秒杀下单页面数据回显
	 */
	@GetMapping("/api/activity/seckill/auth/trade")
	Result<HashMap<String, Object>> trade();

}
